<!--if{$cartData}-->
<main data-dux="cart-count" data-url-num="{url('num')}" data-url-del="{url('del')}" data-url-checked="{url('checked')}">
    <div data-list>
        <!--loop{$cartData as $data}-->
        <div class="dux-box dux-pro-list" data-store>
            <div class="box-header box-header-color dux-flex">
                <div class="uk-margin-small-right">
                    <label><input type="checkbox" class="uk-radio" data-store-checkbox="1"></label>
                </div>
                <a class="flex-1 dux-flex" href="__ROOT__/">
                    <div class="title flex-1">
                        <img src=""
                             alt="">
                        {$site.info_name}
                    </div>
                    <div class="more">
                        <i class="fa fa-angle-right"></i>
                    </div>
                </a>
            </div>
            <!--loop{$data.items as $key => $vo}-->
            <div class="dux-pro-item" data-item id="{$vo.rowid}">
                <div class="item-radio uk-flex uk-flex-middle">
                    <label><input  class="uk-checkbox" type="checkbox" value="{$vo.rowid}" {$vo.checked ? 'checked' : ''}></label>
                </div>
                <div class="item-img">
                    <a href="{$vo.url}"><img src="{$vo.image}" width="90" height="90"></a>
                </div>
                <div class="item-info">
                    <div class="title"><a href="{$vo.url}">{$vo.name}</a></div>
                    <!--if{!empty($vo.options)}-->
                    <p class="uk-margin-small-top" data-show>
                        <!--loop{$vo.options as $v}-->
                        <span class="uk-margin-small-right uk-text-truncate">{$v.name}：{$v.value}</span>
                        <!--{/loop}-->
                    </p>
                    <a href="javascript:;" class="uk-text-truncate uk-margin-small-top uk-hidden select" data-edit data-spec="{url($vo['app'] . '/' . 'Info/spec', ['id' => $vo.app_id, 'pro_id' => $vo.id])}" data-rowid="{$vo.rowid}">
                        <!--loop{$vo.options as $v}-->
                        <span class="uk-margin-small-right">{$v.name}：{$v.value}</span>
                        <!--{/loop}-->
                    </a>
                    <!--{/if}-->
                    <div class="dux-flex uk-margin-small-top">
                        <div class="flex-1 uk-text-danger">￥<span data-item-price>{price_format($vo.total)}</span></div>
                        <div class="uk-text-right">
                            <div class="dux-counter uk-clearfix" data-dux="cart-num" data-callback="count"
                                 data-info='{"rowid" : "{$vo.rowid}", "price" : {$vo.price}}'>
                                <span class="down"></span>
                                <input type="tel" value="{$vo.qty}" data-num>
                                <span class="up"></span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!--{/loop}-->
        </div>
        <!--{/loop}-->
    </div>

    <div class="dux-footer-action-fixed">
        <div class="dux-footer-action">
            <div class="action-info">
                <span class="uk-float-left"><label><input class="uk-checkbox" type="checkbox" data-select-all>全选</label></span> <span class="uk-text-danger uk-float-right">合计:￥<span data-decimal-checked>{$info.checked_total}</span>&nbsp;</span>
            </div>
            <div class="action-btn">
                <a href="{url('submit')}" class="uk-button uk-button-primary" data-show>结算</a>
                <a href="javascript:;" class="uk-button uk-button-primary uk-hidden" data-edit data-del>删除</a>
            </div>

        </div>
    </div>
    <div data-popup>
    </div>
</main>
<!--{else}-->
<main>
    <div class="dux-img-alert">
        <div class="image">
            <img src="" alt="">
        </div>
        <p>购物车还是空的，去逛逛吧</p>
        <div class="action">
            <a href="__ROOT__/" class="uk-button uk-button-default">返回首页</a>
        </div>
    </div>
</main>
<!--{/if}-->


<script type="text/html" data-spec-tpl>
    <div class="dux-popup-fixed dux-popup-active">
        <div class="dux-popup">
            <a href="javascript:;" class="popup-close"></a>
            <div class="popup-header">
                <div class="image">
                    <img src="{{d.info.image}}">
                </div>
                <div class="info">
                    <div class="uk-text-danger uk-text-large">￥{{d.proInfo.sell_price}}</div>
                    <p>选择商品规格</p>
                </div>
            </div>
            <div class="popup-items" data-spec-list>
                {{# for(var i in d.specList) { }}
                <dl>
                    <dt>{{d.specList[i].name}}</dt>
                    <dd>
                        {{# for(var x in d.specList[i].value) { }}
                        <a href="javascript:;" class="{{ (d.specList[i].value[x] == d.specList[i].cur) ? 'active' : '' }}"  data-id="{{d.specList[i].id}}" data-name="{{d.specList[i].name}}" data-value="{{d.specList[i].value[x]}}">{{d.specList[i].value[x]}}</a>
                        {{# } }}
                    </dd>
                </dl>
                {{# } }}
            </div>
            <div class="popup-action">
                <a href="javascript:;" class="uk-button uk-button-primary uk-button-block" data-spec-submit  data-app="{{d.info.app}}">确定</a>
            </div>
        </div>
    </div>
</script>

<script>
    Do('base', 'inobounce');
</script>